package com.eastfair.venueservice.dto;

import com.eastfair.common.dto.AttachmentFileDTO;
import com.eastfair.venueservice.enumeration.ServiceItemAuditStateEnum;
import com.eastfair.venueservice.enumeration.ServiceItemServiceStateEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 实体类
 * 服务项
 * </p>
 *
 * @author linan
 * @since 2022-07-13
 */
@Data
@ApiModel(value = "ServiceItemUpdateDTO", description = "服务项")
public class ServiceItemDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @NotNull(message = "主键不能为空",groups = {UpdateCheck.class, Primary.class})
    private Long id;

    /**
     * 来源服务id
     */
    @ApiModelProperty(value = "来源服务id")
    private Long sourceId;
    /**
     * 来源系统
     */
    @ApiModelProperty(value = "来源系统")
    @Size(max = 255, message = "来源系统长度不能超过255")
    private String sourceProvider;

    /**
     * 服务名称
     */
    @ApiModelProperty(value = "服务名称")
    @Size(max = 255, message = "服务名称长度不能超过255")
    @NotEmpty(message = "服务名称不能为空",groups = {AddCheck.class,UpdateCheck.class})
    private String serviceName;
    /**
     * 服务图片
     */
    @ApiModelProperty(value = "服务图片")
    @Size(max = 255, message = "服务图片长度不能超过255")
    private String picUrl;
    /**
     * 服务图片列表
     */
    @ApiModelProperty(value = "服务图片列表")
    @NotEmpty(message = "服务图片不能为空",groups = {AddCheck.class,UpdateCheck.class})
    private List<AttachmentFileDTO> picList;
    /**
     * 服务分类id
     */
    @ApiModelProperty(value = "服务分类id")
    @NotNull(message = "服务分类不能为空",groups =  {AddCheck.class,UpdateCheck.class})
    private Long serviceCategoryId;
    /**
     * 计量单位 字典维护
     */
    @ApiModelProperty(value = "计量单位 字典维护")
    @Size(max = 255, message = "计量单位 字典维护长度不能超过255")
    @NotNull(message = "计量单位不能为空",groups =  {AddCheck.class,UpdateCheck.class})
    private String calUnit;
    /**
     * 最小预定量
     */
    @ApiModelProperty(value = "最小预定量")
    @NotNull(message = "最小预定量不能为空",groups =  {AddCheck.class,UpdateCheck.class})
    private Integer minAllocatedNum;
    /**
     * 服务部门id/服务商id/主场id
     */
    @ApiModelProperty(value = "服务部门id/服务商id/主场id")
    private Long serviceProviderId;
    /**
     * 供应商类型 字典维护
     */
    @ApiModelProperty(value = "供应商类型 字典维护")
    @Size(max = 255, message = "供应商类型 字典维护长度不能超过255")
    private String serviceProviderType;
    /**
     * 服务状态  #{DEFAULT:默认;ON_SHELVES:已上架;UNDER_SHELVES:已下架}
     */
    @ApiModelProperty(value = "服务状态  #{DEFAULT:默认;ON_SHELVES:已上架;UNDER_SHELVES:已下架}")
    @NotNull(message = "服务状态不能为空")
    private ServiceItemServiceStateEnum serviceState;
    /**
     * 审核状态 #{DEFAULT:默认;APPROVED:已审核;NOT_APPROVED:未审核}
     */
    @ApiModelProperty(value = "审核状态 #{DEFAULT:默认;APPROVED:已审核;NOT_APPROVED:未审核}")
    private ServiceItemAuditStateEnum auditState;

    @ApiModelProperty(value = "服务明细")
    @NotEmpty(message = "服务明细不能为空",groups =  {AddCheck.class,UpdateCheck.class})
    private List<ServiceItemDetailDTO> serviceItemDetailList;
    /**
     * 场馆综合展会ID
     */
    @ApiModelProperty(value = "场馆综合展会ID")
    private Long exhibitionManageId;
    /**
     * 场馆综合展会ID
     */
    @ApiModelProperty(value = "折扣利率")
    @Size(max = 3,message = "折扣利率最多设置三条",groups =  {AddCheck.class,UpdateCheck.class})
    private List<ServiceItemDiscountDTO> serviceItemDiscountList;
    /**
     * 服务部门id集合
     */
    @ApiModelProperty(value = "服务部门id集合")
    private List<Long> serviceProviderIds;

    /**
     * 保存校验标识
     */
    public interface AddCheck {};

    /**
     * 修改校验标识
     */
    public interface UpdateCheck {};

    /**
     * 上下架参数校验
     */
    public interface Primary {};
}
